import request from '@/utils/request'

export function getSiteList(query) {
  return request({
    url: '/site',
    method: 'get',
    params: query
  }).then(res => {
    return res.data
  })
}

export function getSiteRecycleBinList(query) {
  return request({
    url: '/site-recycle-bin',
    method: 'get',
    params: query
  }).then(res => {
    return res.data
  })
}

export function getInfo(id) {
  return request({
    url: '/site/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/site',
    method: 'post',
    data
  })
}

export function update(id, data) {
  return request({
    url: '/site/' + id,
    method: 'put',
    data
  })
}

export function siteWebCreate(data) {
  return request({
    url: '/site-web-create',
    method: 'post',
    data
  })
}

export function remove(id) {
  return request({
    url: '/site/' + id,
    method: 'delete'
  })
}

export function restore(id) {
  return request({
    url: '/site-restore/' + id,
    method: 'put'
  })
}

